<template>
	<hover-container class="w-40px h-full" :inverted="themeStore.navTheme === 'dark'" tooltip-content="主题模式">
		<dark-mode-switch :dark="themeStore.darkMode" :customize-transition="themeStore.isCustomizeDarkModeTransition"
			class="wh-full" @update:dark="updateDarkMode" />
	</hover-container>
</template>

<script lang="ts" setup>
import { useThemeStore } from "@/store";
import { useDark, useToggle } from "@vueuse/core";
const isDark = useDark({
	selector: 'html',
	attribute: 'class',
	valueDark: 'dark',
});
defineOptions({ name: 'ThemeMode' });

const themeStore = useThemeStore();

const updateDarkMode = (darkMode: boolean) => {
	useToggle(isDark)();
	themeStore.setDarkMode(darkMode);
};
</script>

<style scoped></style>
